"""
A dummy application that just shows how to set up some localization. Used to demonstrate
how the rules and actions of the pymak make system help build components.
"""

import sys
import os
import logging
import gettext


# this installs a _() method into the builtins using the gettext messages that
# are defined for the current locale.
gettext.translation('foo', os.path.join(os.getcwd(), 'resources'), fallback=True).install()

def main():
    if '--inv-lang' in sys.argv:
        # for testing, the make system should have created a Zulu locale
        # which contains the messages replaced with inverted case.
        zulu = gettext.translation('foo', os.path.join(os.getcwd(), 'resources'), ['zu'])
        zulu.install()

    # let's see if localization is going to work:
    logging.warning( _("Running the module '%s'"), __file__)
